package exp1;

import java.util.Random;
import java.util.Scanner;

public class Random2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int maxn = (int)1e6 + 5;
        boolean [] flag = new boolean[maxn];
        Random rand = new Random();
        int cnt = 0;
        // start
        long stime = System.nanoTime();
        while (cnt < n) {
            int temp = rand.nextInt(n) + 1;
            if (!flag[temp]) {
                System.out.print(temp + " ");
                flag[temp] = true;
            } else {
                continue;
            }
            cnt++;
        }
        // end;
        long etime = System.nanoTime();
        System.out.println();
        System.out.println(etime - stime);
    }
}
